<?php

namespace Acme\StaffBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Acme\StaffBundle\Entity\CategoryStaff
 *
 * @ORM\Table(name="category_staff")
 * @ORM\Entity
 */
class CategoryStaff
{
    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @var string $name
     *
     * @ORM\Column(name="name", type="string", length=50, nullable=false)
     */
    private $name;
    
    /**
     *
     * @var Staff
     * 
     * @ORM\OneToMany(targetEntity="Staff", mappedBy="category")
     */
    private $staffs;
    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set name
     *
     * @param string $name
     */
    public function setName($name)
    {
        $this->name = $name;
    }

    /**
     * Get name
     *
     * @return string 
     */
    public function getName()
    {
        return $this->name;
    }
    
    public function __toString() {
        return $this->name;
    }
    public function __construct()
    {
        $this->staffs = new \Doctrine\Common\Collections\ArrayCollection();
    }
    
    /**
     * Add staffs
     *
     * @param Acme\StaffBundle\Entity\Staff $staffs
     */
    public function addStaff(\Acme\StaffBundle\Entity\Staff $staffs)
    {
        $this->staffs[] = $staffs;
    }

    /**
     * Get staffs
     *
     * @return Doctrine\Common\Collections\Collection 
     */
    public function getStaffs()
    {
        return $this->staffs;
    }
}